﻿<form action="index.php" method="post" name="addFrom" >
<table>
	<tr style="border:1px solid silver">
		<td style="background:silver;"><h4>Gửi mail tới thành viên</h4></td>
	</tr>
	<tr style="border:1px solid silver">
		<td>Email:<b>
		<?php foreach((array)$this->customer as $cus){ ?>
		<?php $email[]=$cus->email; ?>
		<?php }
		echo implode($email,'; ');
		?>
		</b><a href="index.php?c=custommer">Chọn lại</a></td>
	</tr>
	<tr style="border:1px solid silver">
		<td>
			<select onchange="submitform();" name="articleid" >
			<option value="0" >Tải nội dung từ bài viết</option>
			<?php foreach($this->articles as $article){ ?>
			<?php  if(isset($this->item->id) && @$this->item->id==$article->id ){?>
					<option selected value="<?php echo $article->id ?>"><?php echo $article->title ?></option>
			<?php  }else{ ?>
					<option value="<?php echo $article->id ?>"><?php echo $article->title ?></option>
			<?php }}?>	
			</select>		
		</td>
	</tr>

	<tr style="border:1px solid silver">
		<td>Nội dung
		</td>
	</tr>
	<tr style="border:1px solid silver">
		<td colspan="4">
		<?php sscls_HTML::editer('content',@$this->item->content,120,20) ?>
		</td>
	</tr>
	<tr>
		<td>
			<input type="submit" name="Submit" value="Gửi mail" />
			<input type="button" onclick="document.location.href='index.php?c=custommer';" value="Hủy" />
		</td>
	</tr>
</table>
<input type="hidden" name="c" value="custommer" />
<input type="hidden" name="t" value="proccesssendmail" />
<input type="hidden" name="id" value="<?php echo @(int)$this->item->id ?>" />
</form>
<script >
	function submitform()
	{
			document.addFrom.t.value='sendmailtmpl';
			document.addFrom.submit();
	}
</script>